package com.janus.multitypedemo;


import com.janus.multitypedemo.bean.Ad;
import com.janus.multitypedemo.bean.Banner;
import com.janus.multitypedemo.bean.EmptyValue;
import com.janus.multitypedemo.bean.Good;
import com.janus.multitypedemo.bean.Hot;
import com.janus.multitypedemo.bean.HotList;
import com.janus.multitypedemo.bean.MainGame;
import com.janus.multitypedemo.bean.Title;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by janus on 2017/7/10.
 * MockData
 */

public class MockData {

    public static void init(List<Object> list) {
        list.add(new Banner("http://image.9game.cn/2017/6/22/17298138.jpg"));

        list.add(new Title("分类", "http://image.9game.cn/2017/5/22/16967051.png"));
        list.add(new Title("新游", "http://image.9game.cn/2017/5/3/16754468.png"));
        list.add(new Title("最热", "http://image.9game.cn/2017/5/3/16754469.png"));
        list.add(new Title("单机", "http://image.9game.cn/2017/5/3/16754470.png"));
        list.add(new Title("开测", "http://image.9game.cn/2017/5/22/16967052.png"));

        list.add(new Ad("封神召唤师", "登录领取SSR", "http://image.9game.cn/2017/6/21/17288273_.png"));
        list.add(new Ad("发现好游戏", "主策邀你测游戏", "http://image.9game.cn/2017/6/21/17288261_.png"));

        list.add(new EmptyValue(EmptyValue.TYPE_GOODTITLE));
        list.add(new Good("战地指挥官", "策略 158M", "http://image.game.uc.cn/2017/2/28/16092955_.png"));
        list.add(new Good("封神召唤师", "卡牌 304M", "http://image.game.uc.cn/2017/6/16/17236908_.png"));
        list.add(new Good("决战卡丁车", "竞速 274M", "http://image.game.uc.cn/2017/6/20/17272924_.png"));
        list.add(new Good("究极数码进化", "回合 131M", "http://image.game.uc.cn/2017/6/20/17272813_.png"));
        list.add(new Good("桃花源记", "回合 366M", "http://image.game.uc.cn/2017/6/6/17140285_.png"));
        list.add(new Good("勇者大作战", "休闲 81M", "http://image.game.uc.cn/2017/5/25/17021682_.png"));
        list.add(new Good("地下城堡2", "策略 75M", "http://image.game.uc.cn/2017/5/16/16901758_.png"));
        list.add(new Good("热血江湖", "角色 495M", "http://image.game.uc.cn/2017/5/15/16885347_.png"));

        //人气推荐 为了使用统一的背景 所以封装成了一个item
        List<Hot> hots = new ArrayList<>();
        hots.add(new Hot("梦幻西游", "回合 | 519M", "http://image.9game.cn/2017/6/26/17324447_.png"));
        hots.add(new Hot("王者荣耀", "MOBA | 424M", "http://image.9game.cn/2015/11/8/11320786_.png"));
        hots.add(new Hot("诛仙", "角色 | 556M", "http://image.9game.cn/2017/6/8/17164419_.png"));
        list.add(new HotList(hots, "http://image.9game.cn/s/uae/g/1m/ngp_portal_mobile/page/homesite/index/images/recommend_other_bg_0d68e00.png"));

        list.add(new MainGame("神话永恒", "角色 | 294.4M", "迪丽热巴绝美代言，炫酷魔幻巅峰巨作！", "http://image.game.uc.cn/2017/6/6/17134451_.png"));
        list.add(new MainGame("热血江湖", "角色 | 495.7M", "官方正版授权，青春武侠手游", "http://image.game.uc.cn/2017/5/15/16885347_.png"));
        list.add(new MainGame("地下城堡2", "策略 | 74.8M", "经典传承，文字冒险RPG全新续作", "http://image.game.uc.cn/2017/5/16/16901758_.png"));
        list.add(new MainGame("刀剑兵器谱", "动作 | 202.2M", "刀剑原班人马打造，冷兵器格斗手游", "http://image.game.uc.cn/2017/6/7/17147207_.png"));
        list.add(new MainGame("倩女幽魂", "角色 | 677.4M", "特惠礼包全服PK赛陪你过夏天", "http://image.game.uc.cn/2017/6/19/17257774_.png"));

        list.add(new EmptyValue(EmptyValue.TYPE_LINE));

        list.add(new MainGame("三国挂机名将", "策略 | 44.1M", "三国题材，体验不一样的挂机！", "http://image.game.uc.cn/2017/6/13/17203196_.png"));
        list.add(new MainGame("风之旅团","角色 | 253.8M","技能自由搭配，无职业设定动作手游","http://image.game.uc.cn/2017/5/16/16915025_.png"));
        list.add(new MainGame("碧蓝航线","卡牌 | 222.5M","此身为舰，即刻出战！","http://image.game.uc.cn/2017/5/15/16896927_.png"));
        list.add(new MainGame("贪吃蛇大作战","休闲 | 27.0M","2017全新战队系统上线！","http://image.game.uc.cn/2017/4/24/16665104_.png"));
        list.add(new MainGame("王者传奇","角色 | 160.0M","官方正版，无传奇不兄弟","http://image.game.uc.cn/2017/6/26/17318995_.png"));

    }

    public static int getTotal(int[] ints) {
        if (ints == null || ints.length == 0) return 1;
        int total = 1;
        for (int anInt : ints) {
            total = total * anInt;
        }
        return total;
    }

}
